package com.dyc.caradvertisting.ui.fmt.tab.circle;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.dyc.caradvertisting.R;
import com.dyc.caradvertisting.event.StartBrotherEvent;
import com.dyc.caradvertisting.ui.fmt.tab.circle.plan.CplanFragment;
import com.dyc.caradvertisting.ui.fmt.tab.mine.details.MineDetailsFmt;
import com.dyc.caradvertisting.widget.circle.LoadingLayout;
import com.dyc.caradvertisting.widget.circle.TBRecyclerView;
import com.njh.tools.base.BaseFragment;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 圈发
 */
public class CircleFragment extends BaseFragment {


    @BindView(R.id.tvr_content)
    TBRecyclerView tvrContent;

    public CircleFragment() {
        // Required empty public constructor
    }

    public static CircleFragment newInstance() {
        CircleFragment fragment = new CircleFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        return getView(inflater, container);
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_circle;
    }

    @Override
    public void initView(View baseView) {
        ButterKnife.bind(this, baseView);
        initToolbar(R.string.title_circle);
        tvrContent.fetch();
        tvrContent.mloading_view.setOnloadingListener(new LoadingLayout.OnloadingListener() {
            @Override
            public void onEmpty(int id) {
                switch (id){
                    case R.id.rt_send_circle:
                        EventBus.getDefault().post(new StartBrotherEvent(CplanFragment.newInstance()));
                        break;
                    case R.id.rt_look_circle:
                        break;
                }
            }

            @Override
            public void onError() {

            }
        });
    }

    @Override
    public boolean isSwipeBack() {
        return false;
    }

    @Override
    public void initPresenter() {

    }
}
